{	Problem: http://codeforces.ru/problemset/problem/27/B
	Verdict: Accepted
}
{$R+,S+,Q+,I+,C+,M+,H+,O-}
uses SysUtils;
var i,n,x,y,k:longint; a,w:array[1..60] of longint; b:array[1..60,1..60] of boolean;
begin
fillchar(b,sizeof(b),false);
fillchar(A,sizeof(a),0);
fillchar(w,sizeof(w),0);
read(n);
k:=n*(n-1) div 2-1;
for i:=1 to k do begin
  read(x,y);
  inc(a[x]);
  inc(a[y]);
  b[x][y]:=true;
  b[y][x]:=false;
  inc(w[x]);
end;
k:=n-1;
x:=0;
y:=0;
for i:=1 to n do begin
  if a[i]<>k then
    if x=0 then x:=i else
    if y=0 then y:=i;
  if (x<>0) and (y<>0) then break;
end;
if w[x]<w[y] then write(y,' ',x) else write(x,' ',y);
end.